# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: Andre Klitzing <aklitzing () online () de>

pkgname=libytnef
pkgver=2.1.1
pkgrel=1
epoch=1
pkgdesc="Yerase's TNEF Stream Reader library (decodes winmail.dat)"
url="https://github.com/Yeraze/ytnef"
license=(GPL)
arch=(x86_64)
depends=(glibc)
makedepends=(perl git)
optdepends=('perl: ytnefprocess')
provides=(libytnef.so)
_commit=284d74667a0611b65d4c5ab41a92fceda5445404
source=("git+https://github.com/Yeraze/ytnef#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd ytnef
  git describe --tags | sed 's/^v//;s/-/+/g'
}

prepare() {
  cd ytnef
  ./autogen.sh
}

build() {
  cd ytnef
  ./configure --prefix=/usr --disable-static
  make
}

package() {
  cd ytnef
  make DESTDIR="$pkgdir" install
}
